﻿@namespace MudBlazor
@using MudBlazor.Interfaces
@typeparam T
@inherits MudFormComponent<T, T>

<MudInputControl Class="@Classname" Style="@Style" Error="@HasErrors" ErrorText="@GetErrorText()" Required="@Required">
    <InputContent>
        <CascadingValue Value="@((IMudRadioGroup)this)" IsFixed="false">
            @* Form should be cascaded as null so the childs are not registered to the Form *@
            <CascadingValue TValue="IForm" Value="null">
                <CascadingValue TValue="bool" Name="ParentDisabled" Value="@GetDisabledState()">
                    <CascadingValue TValue="bool" Name="ParentReadOnly" Value="@GetReadOnlyState()">
                        <div role="radiogroup" @attributes="UserAttributes" class="@GetInputClass()" style="@InputStyle" required="@Required" aria-required="@Required.ToString().ToLowerInvariant()">
                            @ChildContent
                        </div>
                    </CascadingValue>
                </CascadingValue>
            </CascadingValue>
        </CascadingValue>
    </InputContent>
</MudInputControl>